import pickle
import os
os.chdir("./")
for file in os.listdir(".") :
	if file.startswith('input') :
		f = open(file)
		a = pickle.load(f)
		s = set(map(lambda x: x[0], a))

		print "%s\t%s" % (file, str(len(s)))